package logic

import (
	"context"
	"wechats/model/mysql"

	"wechats/wechatrpc/internal/svc"
	"wechats/wechatrpc/wechatrpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type MomentDelLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewMomentDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *MomentDelLogic {
	return &MomentDelLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *MomentDelLogic) MomentDel(in *wechatrpc.MomentDelRequest) (*wechatrpc.MomentDelResponse, error) {
	// todo: add your logic here and delete this line

	mysql.DB.Debug().Where("id=?", in.Id).Delete(&mysql.Personal{})
	return &wechatrpc.MomentDelResponse{}, nil
}
